// api: String      请求地址
// params: Object   请求参数
// return promise

module.exports = function(api, params) {
    return new Promise((resolve, reject) => {
        wx.request({
            url: api,
            data: params,
            header: {'Content-Type': 'json'},
            success: resolve,
            fail: reject
        })
    })
}